package org.jeecg.modules.system.entity;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.io.Serializable;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 用户表
 * </p>
 *
 * @Author scott
 * @since 2018-12-20
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class SysUser implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "主键ID")
    private String id;

    /**
     * 登录账号
     */
    @Excel(name = "登录账号", width = 15)
    @ApiModelProperty(value = "登录账号")
    private String username;

    /**
     * 姓名
     */
    @Excel(name = "姓名", width = 15)
    @ApiModelProperty(value = "姓名")
    private String realname;

    /**
     * 密码
     */
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    @ApiModelProperty(value = "密码")
    private String password;

    /**
     * md5密码盐
     */
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    @ApiModelProperty(value = "md5密码盐")
    private String salt;

    /**
     * 头像
     */
    //@Excel(name = "头像", width = 15,type = 2)
    @ApiModelProperty(value = "头像")
    private String avatar;

    /**
     * 生日
     */
    //@Excel(name = "生日", width = 15, format = "yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "生日")
    private Date birthday;

    /**
     * 性别（1：男 2：女）
     */
    @Excel(name = "性别", width = 15,dicCode="sex")
    @Dict(dicCode = "sex")
    @ApiModelProperty(value = "性别")
    private Integer sex;

    /**
     * 电子邮件
     */
    //@Excel(name = "电子邮箱", width = 15)
    @ApiModelProperty(value = "电子邮箱")
    private String email;

    /**
     * 电话
     */
    @Excel(name = "电话", width = 15)
    @ApiModelProperty(value = "电话")
    private String phone;

    /**
     * 部门code(当前选择登录部门)
     */
    private String orgCode;

    /**部门名称*/
    private transient String orgCodeTxt;

    /**
     * 状态(1：正常  2：冻结 ）
     */
    @Excel(name = "状态", width = 15,dicCode="user_status")
    @Dict(dicCode = "user_status")
    @ApiModelProperty(value = "状态")
    private Integer status;

    /**
     * 删除状态（0，正常，1已删除）
     */
    //@Excel(name = "删除状态", width = 15,dicCode="del_flag")
    @TableLogic
    @ApiModelProperty(value = "删除状态")
    private Integer delFlag;

    /**
     * 工号，唯一键
     */
   //@Excel(name = "工号", width = 15)
    @ApiModelProperty(value = "工号")
    private String workNo;

    /**
     * 职务，关联职务表
     */
    @Excel(name = "职务", width = 15)
    @Dict(dicCode = "position_rank")
    @ApiModelProperty(value = "职务")
    private String post;

    @Dict(dictTable ="fh_team",dicText = "name",dicCode = "id")
    @ApiModelProperty(value = "所属队伍")
    private String teamId;


    /**
     * 创建人
     */
    private String createBy;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新人
     */
    private String updateBy;

    /**
     * 更新时间
     */
    private Date updateTime;


    /**
     * 负责部门
     */
   // @Excel(name="负责部门",width = 15,dictTable ="sys_depart",dicText = "depart_name",dicCode = "id")
    @Dict(dictTable ="sys_depart",dicText = "depart_name",dicCode = "id")
    private String departIds;


    /**设备id uniapp推送用*/
    @ApiModelProperty(value = "设备id uniapp推送用")
    private String clientId;

    /**
     * 登录首页地址
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "登录首页地址")
    private String homePath;


    /**
     * 公司
     */
    @Excel(name="公司名称",width = 15)
    @ApiModelProperty(value = "公司名称")
    private String compName;

    /**
     * 国家
     */
    @Excel(name="国家",width = 15)
    @ApiModelProperty(value = "国家")
    private String country;
    /**
     * 省
     */
    @Excel(name="省",width = 15)
    @ApiModelProperty(value = "省")
    private String province;

    /**
     * 市
     */
    @Excel(name="市",width = 15)
    @ApiModelProperty(value = "市")
    private String city;

    /**
     * 地址
     */
    @Excel(name="地址",width = 15)
    @ApiModelProperty(value = "地址")
    private String address;


    @ApiModelProperty(value = "语言")
    private  String lang;

    /**
     * 微信OpenId
     */
    @ApiModelProperty(value = "OpenId")
    private String openId;

    @Dict(dictTable ="sys_role",dicText = "role_name",dicCode = "id")
    @ApiModelProperty(value = "角色编码")
    private String roleId;

    private transient String roleName;


    private transient String teamName;

    @ApiModelProperty(value = "是否首次登陆 0-是，1-否")
    private String izFirstLogin;

    @ApiModelProperty(value = "身份证号")
    private String idNumber;

    @ApiModelProperty(value = "民族")
    private String nation;



}
